import java.lang.reflect.Method;

/**
 * create by mwh 2022-01-16
 **/

public class TestReflect {

    public void test() throws Exception{
        Class myclass = Class.forName("Myreflect");
        Method[] methods =  myclass.getDeclaredMethods();
        Object obj = myclass.newInstance();
        for(Method method:methods){
            System.out.println("hhhahh=====前");
            method.invoke(obj);
           String name =  method.getName();
            System.out.println("hhhahh=====后"+name);
        }
    }

    public static void main(String[] args) throws Exception {
            TestReflect testReflect = new TestReflect();
            testReflect.test();
    }
}
